GNUH8 v0603

October 3rd, 2006

KPIT Cummins Infosystems Limited is now releasing GNUH8 v0603, a cross compiler toolchain for

Renesas (formerly Hitachi and Mitsubishi) H8 series of micro controllers.

SALIENT FEATURES:

1.

GNUH8 v0603 is based on gcc-4.2-20060812, binutils-2.17, newlib-1.14.0 and gdb-6.5 (released).

2.

The latest patches have been applied to gcc, binutils and newlib.

3.

'Static Analysis' feature has been added in GNUH8 compiler to perform extra build time checks on user C-source code upon passing a command line switch. The compiler advises programmer to improve upon the code efficiency

4.

Selection of optimization options in HEW is simplified to provide more efficient options for speed and code size optimization.

5. Optimized libraries for GNUH8 are further optimized to achieve upto 30% code size reduction.

Please refer to the FAQ for details of the patches applied to the sources.
http://www.kpitgnutools.com/phpmyfaq/index.php?sid=16957&aktion=artikel&rubrik=001005&id=42&lang=en

ABOUT GNUH8 v0603:

Release version: GNUH8 v0603
Release Date: October 3rd, 2006
Platforms Supported: Red Hat GNU/Linux v8.0 or later (or compatible distribution)
Windows NT/2000/XP
Language: C, C++
Targets: H8/300, 

H8/300L, 

H8/300H,

H8/300H Tiny Series,

H8/S 2XXX,
H8/S 26XX,
H8/SX
Object File Format: ELF


Please register at http://www.kpitgnutools.com for free technical support.
Please contact http://www.kpitgnutools.com/feedback.php for any feedback or suggestions.

CHANGES IN THIS RELEASE:

BINUTILS:

1. User defined sections with keyword 'NOLOAD' were marked as loadable in case of v0602 toolchain.
This bug has been fixed.

GCC:

1.

'Static Analysis' feature has been added in GNUH8 compiler to perform extra build time checks on user C-source code upon passing a command line switch "-Wanalyze". The compiler advises the programmer to improve upon the code so as to generate more efficient and reliable code. Static analysis feature can be invoked on command prompt using option '-Wanalyze'. This option will analyze application code for different set of rules and prompt warnings. These warnings will be prompted against violation of rules. You can specifically enable warning for a particular rule using command line option '-Wanalyze-rule='. Also, warning for aparticular rule can be disabled using command line option '-Wno-analyze-rule='.
However, this option should be preceded by '-Wanalyze' option. For more information on the same, please refer to the GCC user manual.
E.g:
* If you want to analyze code for all rules, then use '-Wanalyze' option.
* If you want to analyze code for only rule 1, then use '-Wanalyze-rule=1' option.
* If you want to analyze code for all rules except rule 1, then use  '-Wanalyze' option followed by '-Wno-analyze-rule=1' option.

2.

Support for 'bset' instruction has been added in GNUH8 compiler.

3.

While using optimized libraries, use of 'Ctype Library Function' in C source file (with #include <ctype.h>), used to give error "undefined reference to `___ctype_ptr' ".

This has been fixed.

HEW (For Windows OS only):

1.

Selection of optimization options in HEW is simplified to provide more efficient options for speed and code size optimization.

2.

Support for 'Static Analysis' feature has been added in HEW.

3.

HEW used to crash if user goes to 'Build->Compiler' (before doing any other operation in HEW) after opening a new/existing project in HEW.
This bug has been fixed.

4.

HEW dependency scanner used to display errors for scanning of dependencies for C++ files when included file do not have any extension.
This bug has been fixed.

5.

'Warning Options' and 'Other Compiler Options' were not getting included while generating makefile for any reopened project.
This bug has been fixed.

6.

In order to enable the debugging of user applications on target using HMON in HEW 4.x environment, RSK support is required. Please refer to the following FAQ link for more information,
http://www.kpitgnutools.com/phpmyfaq/index.php?sid=28137&aktion=
artikel&rubrik=003003&id=341&lang=en

KNOWN PROBLEMS:

We intend to fix the known problems in our future releases.
We also release Maintenance Packs for critical bugs fixed in between releases.

H8-ELF:

Windows and GNU/Linux:
1.

Assembler gives error while building the following code with
optimization enabled,

unsigned long x[4];

void foo(void)
{
((void (*)())(x+2))();
}.

2.

Following code if compiled for H8300H, H8300HN, H8S, H8300SN, H8SX, H8SXN targets with optimization option -O1 and above, generates wrong assembly code.

unsigned int ReadWordx86Style(unsigned long lAddr)
{
unsigned char baBuff[2];
baBuff[0x00]=*((unsigned char *)((unsigned int)(lAddr+1)));
baBuff[0x01]=*((unsigned char *)((unsigned int)(lAddr+0)));
return((*(unsigned int *)baBuff));
}

int start(void)
{
unsigned char baBuff[256];
unsigned int wResult;
wResult = ReadWordx86Style((unsigned long)((unsigned int)baBuff));
return(wResult);
}.

3.

The '.tinybss' implementation does not work as expected.

4.

h8300-elf-as does not give error if attribute of a section is not specified.

5. Functions 'getchar', 'gets' and 'scanf' of NEWLIB as well as of optimized libraries are not working for H8300HN, H8300SN, H8SXN targets.
6.

If '.data' section is empty, the '.bss' section follows '.rodata' section instead of following the '.data' section. Due to this, all un-initialized variables are placed in ROM area. However, this can be avoided by modifying the linker script for '.bss' to follow '.data' section by using '_edata' label OR just by declaring a dummy initialized variable that will be placed in '.data'.

HEW (For Windows OS only):

1.

While debugging applications in HEW, Stack trace information is not available.

2.

In HEW, on using the optimized libraries with C++ project, the linker generates error of "undefined references" to some routines while building the project, as some of the ANSI C library functions are not implemented in H8 optimized libraries.

Workaround:
User can add own implementation of these functions or can provide with dummy implementations depending upon the use.

 NOTE:

Windows and GNU/Linux:

1.

Further optimization has been done on GNUH8 libraries. The optimized library has not been provided under GNU GPL. The source code of the optimized library is neither released nor available on request.

2

Latest GDB and simulator, provided with this toolchain release must be used with v0603 toolchain.

3.

Renesas have notified us of an error in H8SX CPU data transfer instructions (MOVMD.B/W/L, MOVSD). The error can occur in two scenarios:

Scenario 1: When the transfer source address "ER5" is set by a load from memory, multiplication or STMAC instruction and followed by a MOVMD or MOVSD instruction, the number of transfers is incorrectly reduced by 1.
An example would be as follows:

MOV.L @LABEL,ER5
MOVMD.B

Scenario 2: When the transfer destination address "ER6" is set by a load from memory, multiplication or STMAC instruction and followed by a MOVMD.L instruction, an address error might occur. An example would be as follows:

MOV.L @LABEL,ER6
MOVMD.L

The error does not occur under the following conditions: where ERx is loaded using register direct addressing, where ERx is loaded using an immediate data operand or setting ER5 and ER6 by some other operation; setting the number of transfers to perform in register R4; or by using
EEPMOV.B/W instructions instead of the MOVMD/MOVSD instruction.

Users of KPIT GNU tools should avoid such assembly sequences in inline-assembly and assembly source files. We are currently investigating whether such sequences are generated by the compiler. If found to be the case, we will modify the compiler to prevent this in a future
release.

In the meantime, users can workaround the error in their code by inserting a NOP instruction between the two instructions, e.g.

MOV.L @LABEL, ER5
NOP
MOVMD.B

or:

MOV.L @LABEL, ER6
NOP
MOVMD.L